package com.woniuxy.ticketmovie.entity;

import java.io.Serializable;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.woniuxy.ticketmovie.checkoutGroup.TicketTypeId;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Digits;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

@Data
@TableName("ticket_type")
public class TicketType implements Serializable {
    /**
     *id
     */
    @TableId(type = IdType.AUTO)
    @NotNull(message = "id不能为空")
    @Min(value = 1,message = "id不能小于0",groups = TicketTypeId.class)
    private Integer id;

    /**
     *类型
     */
    @NotNull(message = "姓名 不允许为空")
    @Length(min = 2, max = 5, message = "姓名长度必须在{min} - {max}之间")
    private String name;

    private static final long serialVersionUID = 1L;
}

